package com.roy.rocketmq.basic;

import org.apache.rocketmq.spring.annotation.ConsumeMode;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;

import org.springframework.messaging.Message;
import org.springframework.stereotype.Component;


/**
 * 注意下@RocketMQMessageListener这个注解的其他属性
 *
 * @author ：楼兰
 * @date ：Created in 2020/10/22
 * @description: https://blog.csdn.net/zhoudingding/article/details/106942574
 **/
@Component
@RocketMQMessageListener(
        consumerGroup = "MyConsumerGroup",
        topic = "TestTopic",
        consumeMode = ConsumeMode.CONCURRENTLY

)
public class SpringConsumer implements RocketMQListener<String> {
    @Override
    public void onMessage(String message) {
        System.out.println(" TestTopic Received1 message : " + message);
    }


//    @Override
//    public void onMessage(String message) {
//        System.out.println(" TestTopic Received1 message : " + message);
//    }


}
